﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kaidou.Util;
using System.Resources;

namespace Kaidou.Bll
{
    /*zhou-anyuan*/
    public class ReceiptOrderStarter
    {

        public ReceiptOrderStarter(ResourceManager resourceManager)
        {

		try {
			LogManager.info("ReceiptOrderStarter - #############################################################");
			LogManager.info("ReceiptOrderStarter - #                    Start batch script                     #");
			LogManager.info("ReceiptOrderStarter - #############################################################");
			//Logger.logWrite(ReceiptOrderStarter.class.getName(), "I", "ReceiptOrder Start!! --------------------------");

            TRN_ReceiptOrderManager2 manager = TRN_ReceiptOrderManager2.checkout(resourceManager);
			if (manager != null) {
				try {
					manager.exec();
				} finally {
					TRN_ReceiptOrderManager2.checkin();
					manager = null;
				}
			} else {
				LogManager.info("ReceiptOrderStarter - ReceiptOrder canceled = Other \"ReceiptOrder\" process is running --------------------------");
			}

			LogManager.info("ReceiptOrderStarter - ReceiptOrder End!! --------------------------");

		} catch (Exception e) {
			LogManager.info("ReceiptOrderStarter - ReceiptOrder Exception! "+e.ToString());
            LogManager.info("ReceiptOrderStarter - ReceiptOrder Failed!! ---------------------------");
		}

		return;
	}
    }
}
